﻿using Parylene_CVD.Model.DModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Parylene_CVD.DAL
{
    public class AlarmEventsDAL : BaseDAL<AlarmEvents>
    {
        public List<AlarmEvents> GetAllAlarmEvents()
        {
            return GetModelList("");
        }
        public List<AlarmEvents> GetAlarmEvents(string strWhere, string strCols)
        {
            return GetModelList(strWhere, strCols, null);
        }

        public List<AlarmEvents> GetPageAlarmEvents(int pageIndex, int pageSize, string strCols)
        {
            string whereCondition = "1=1"; // 查询条件
            string orderBy = "AlarmStartTime DESC"; // 按日期倒序排列
            return GetPagedList(pageIndex, pageSize, whereCondition, strCols, orderBy, null);
        }

        public int GetAlarmEventsRecordCount()
        {
            return GetRecordCount();
        }

        public int AddAlarmEvents(AlarmEvents AlarmEvents, string strCols)
        {
            int a = Add(AlarmEvents, strCols, 0);
            return a;
        }

        public bool AddListAlarmEvents(List<AlarmEvents> AlarmEventss, string strCols)
        {
            bool a = AddList(AlarmEventss, strCols);
            return a;
        }

        public bool UpdataAlarmEvents(AlarmEvents AlarmEvents, string strCols)
        {
            return Update(AlarmEvents, strCols);
        }
        public bool UpdataAlarmEvents(AlarmEvents AlarmEvents, string strCols, string strWhere)
        {
            return Update(AlarmEvents, strCols, strWhere, null);
        }
        public bool UpdataListAlarmEvents(List<AlarmEvents> AlarmEventss, string strCols)
        {
            return UpdateList(AlarmEventss, strCols);
        }

        public bool DeleteAlarmEventsByID(object id)
        {
            return Delete(id);
        }

        public bool DeleteAlarmEvents(string strWhere)
        {
            return Delete(strWhere, null);
        }

        public bool DeleteListAlarmEventsByID(List<object> idList)
        {
            return DeleteList(idList);
        }


    }
}
